
/**
 * @desc:  OTA管理查看
 * @author XiongYi
 * @date 2022/11/7
*/
<template>
    <el-dialog :visible="detailFlag" class="khzhgl-xq-dialog" width="400px" :title="title" :before-close="handleCloseDialog">
        <div class="xqItem m-b-16">
            <!--文件名-->
            <div class="xql">{{this.i18n.t('file name')}}</div>
            <div class="xqr" :title="pageData.fileName">{{pageData.fileName}}</div>
        </div>
        <div class="xqItem m-b-16">
            <!--版本名称-->
            <div class="xql">{{this.i18n.t('Version Name')}}</div>
            <div class="xqr">{{pageData.name}}</div>
        </div>
        <div class="xqItem m-b-16">
            <!--版本号-->
            <div class="xql">{{this.i18n.t('Version number')}}</div>
            <div class="xqr">{{pageData.version}}</div>
        </div>
        <div class="xqItem m-b-16">
            <!--版本说明-->
            <div class="xql">{{this.i18n.t('release note')}}</div>
            <div class="xqr">{{pageData.description}}</div>
        </div>
        <div class="xqItem m-b-16">
            <!--适用机型-->
            <div class="xql">{{this.i18n.t('Application')}}</div>
            <div class="xqr">{{pageData.deviceType}}</div>
        </div>
        <div class="xqItem m-b-16">
            <!--适用型号-->
            <div class="xql">{{this.i18n.t('Applicable model')}}</div>
            <div class="xqr">{{pageData.devieModel}}</div>
        </div>
        <div class="footBtnBox">
            <el-button size="small" type="primary" @click="handleCloseDialog">{{this.i18n.t('OK')}}</el-button>
        </div>
    </el-dialog>
</template>

<script>
import { otaGet } from '@/api/otagl'//引入接口
import {getDocument} from "../../../api/document";
export default {
    name: "detail",
    components: {},
    props: {
        detailFlag: {
            type: Boolean,
            default: false
        },

        editTableRow: {
            type: Object,
            defautl: () => {
                return {}
            }
        }
    },
    watch: {
    },
    data() {
        return {
            // 查看
            title: this.i18n.t('view'),
            pageData: {},

        }
    },
    mounted() {
        console.log(this.editTableRow);
        this.getData();
    },
    methods: {
        /**
        * @description  获取详情
        * @return not
        * @author xiongyi 2022-11-18 16:48:08
        **/
        async getData() {
            let res = await getDocument(this.editTableRow.id)
            if (res.code == 200) {
                this.pageData = res.data
            }
        },
        /**
         * @description  关闭弹窗事件
         * @return not
         * @author xiongyi 2022-11-18 16:48:08
         **/
        handleCloseDialog() {
            this.$emit('update:detailFlag', false);
            this.$emit('update:editTableRow', null);

        },


    }
}
</script>

<style scoped lang="scss">
.khzhgl-xq-dialog {
    .xqItem {
        display: flex;
        .xql {
            width: 100px;
            text-align: right;
            margin-right: 10px;
            color: rgba(114, 123, 143, 1);
        }
        .xqr {
            flex: 1;
            color: rgba(38, 43, 50, 1);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
    }
}
</style>
